/* 主进程 */
const { ipcMain, BrowserWindow, app } = require("electron");

// 监听渲染进程退出操作
ipcMain.on('exit-app', (event, data) => {
    switch (data) {
        case "close":
            var window = BrowserWindow.getFocusedWindow();
            if (window) {
                window.close();
            }
            break;
        case "quit":
            app.quit();
            break;
        default:
            break;
    }
});